﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FakeXiecheng.API.Models
{
    /// <summary>
    ///  3.3所添加的 Step1
    /// </summary>
    public class TouristRoute
    {
        [Key]
        public Guid Id { get; set; }
        [Required]
        [MaxLength(100)]
        public string Title { get; set; }
        [Required]
        [MaxLength(1500)]
        public string Description { get; set; }
        [Column(TypeName = "decimal(18, 2)")]
        public decimal OriginalPrice { get; set; }
        [Range(0.0, 1.0)]
        public double? DiscountPresent { get; set; }
        public DateTime CreateTime { get; set; }
        public DateTime? UpdateTime { get; set; }
        public DateTime? DepartureTime { get; set; }
        [MaxLength]
        public string Features { get; set; }
        /// <summary>
        /// 费用
        /// </summary>
        [MaxLength]
        public string Fees { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength]
        public string Notes { get; set; }
        /// <summary>
        /// 声明外键关系,初始化一个数组,但与数据库创建无关,只是为了让代码更健壮,避免程序错误
        /// </summary>
        public ICollection<TouristRoutePicture> TouristRoutePictures { get; set; }
            = new List<TouristRoutePicture>();

        /// <summary>
        /// 评分 3-10
        /// </summary>
        public double? Rating { get; set; }

        /// <summary>
        /// 旅行天数, 使用枚举作为数据类型
        /// </summary>
        public TravelDays? TravelDays { get; set; }

        /// <summary>
        /// 旅行类型
        /// </summary>
        public TripType? TripType { get; set; }

        /// <summary>
        /// 出发地
        /// </summary>
        public DepartureCity? DepartureCity { get; set; }
    }
}
